const db = require('mssql');

db.on('error', err => {
    console.log(err);
});

const config = {
    user: 'sa',
    password: '1111',
    server: '192.168.1.1\\sql2008',
    database: 'TMS2017'
};

const pool = new db.ConnectionPool(config, err => {
    if (err) {
        console.log(err);
    }

    let request = pool.request();
    request.query('select 1 as number', err => {
        if (err) {
            console.log(err);
        }
        pool.id = new Date().toString();
    });
});

exports.pool = pool;